bitkeeper revision 1.1389.5.40 (428084e6OcTkByL6plgj4UPN6alYkA)
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 10 May 2005 09:54:46 +0000 (09:54 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 10 May 2005 09:54:46 +0000 (09:54 +0000)
Fix the 64-bit build.
Signed-off-by: Keir Fraser <keir@xensource.com>
.rootkeys
xen/arch/x86/acpi/boot.c
xen/arch/x86/mm.c
xen/arch/x86/mpparse.c
xen/arch/x86/shadow.c
xen/common/sched_sedf.c
xen/include/asm-x86/bitops.h
xen/include/asm-x86/x86_32/domain_page.h
xen/include/asm-x86/x86_64/domain_page.h
xen/include/xen/inttypes.h [new file with mode: 0644]
xen/include/xen/lib.h

index f74260440979fdb833525ca1aeef13d5f29313c3..8ae8c05f21b2ed53767dc3ff890d6454cafe5455 100644 (file)
--- a/.rootkeys
+++ b/.rootkeys
 3ddb79c1W0lQca8gRV7sN6j3iY4Luw xen/include/xen/event.h
 41262590CyJy4vd42dnqzsn8-eeGvw xen/include/xen/grant_table.h
 3ddb79c0GurNF9tDWqQbAwJFH8ugfA xen/include/xen/init.h
+428084e41zemtCAtYLcD9bUzwE35SA xen/include/xen/inttypes.h
 3ddb79c1nzaWu8NoF4xCCMSFJR4MlA xen/include/xen/ioport.h
 3ddb79c2qAxCOABlkKtD8Txohe-qEw xen/include/xen/irq.h
 3ddb79c2b3qe-6Ann09FqZBF4IrJaQ xen/include/xen/irq_cpustat.h
index 971b3d352ce0ea6f116cf2bb20b571677d3d843d..184d10af9b831e97fa9b4a2e14ac45c1b8288695 100644 (file)
@@ -44,7 +44,6 @@ int sbf_port; /* XXX XEN */
 static inline void  acpi_madt_oem_check(char *oem_id, char *oem_table_id) { }
 extern void __init clustered_apic_check(void);
 static inline int ioapic_setup_disabled(void) { return 0; }
-#include <asm/proto.h>
 
 #else  /* X86 */
 
@@ -110,7 +109,7 @@ char *__acpi_map_table(unsigned long phys_addr, unsigned long size)
        if (!phys_addr || !size)
        return NULL;
 
-       if (phys_addr < (end_pfn_map << PAGE_SHIFT))
+       if (phys_addr < (max_page << PAGE_SHIFT))
                return __va(phys_addr);
 
        return NULL;
@@ -155,7 +154,7 @@ char *__acpi_map_table(unsigned long phys, unsigned long size)
                mapped_size += PAGE_SIZE;
        }
 
-       return ((unsigned char *) base + offset);
+       return ((char *) base + offset);
 }
 #endif
 
index 2f4356477a1864578a552fc8563b1e60bf3eb5d1..f62ab9c91d9c45e41c10cd73c42a9f55c5dc11da 100644 (file)
@@ -1813,8 +1813,7 @@ int do_mmu_update(
     struct exec_domain *ed = current;
     struct domain *d = ed->domain;
     u32 type_info;
-    struct map_dom_mem_cache mapcache = MAP_DOM_MEM_CACHE_INIT;
-    struct map_dom_mem_cache sh_mapcache = MAP_DOM_MEM_CACHE_INIT;
+    struct map_dom_mem_cache mapcache, sh_mapcache;
 
     LOCK_BIGLOCK(d);
 
@@ -1830,6 +1829,9 @@ int do_mmu_update(
             (void)get_user(done, pdone);
     }
 
+    init_map_domain_mem_cache(&mapcache);
+    init_map_domain_mem_cache(&sh_mapcache);
+
     if ( !set_foreigndom(cpu, foreigndom) )
     {
         rc = -EINVAL;
@@ -2037,8 +2039,8 @@ int do_mmu_update(
     }
 
  out:
-    unmap_domain_mem_cache(&mapcache);
-    unmap_domain_mem_cache(&sh_mapcache);
+    destroy_map_domain_mem_cache(&mapcache);
+    destroy_map_domain_mem_cache(&sh_mapcache);
 
     process_deferred_ops(cpu);
 
index 39a7619edc14252a4612868cdb0eaf5fd9ae884c..09a55805e17d314203a09a4dff2c1183c48a0044 100644 (file)
@@ -690,7 +690,7 @@ void __init get_smp_config (void)
                 * Read the physical hardware table.  Anything here will
                 * override the defaults.
                 */
-               if (!smp_read_mpc((void *)mpf->mpf_physptr)) {
+               if (!smp_read_mpc((void *)(unsigned long)mpf->mpf_physptr)) {
                        smp_found_config = 0;
                        printk(KERN_ERR "BIOS bug, MP table errors detected!...\n");
                        printk(KERN_ERR "... disabling SMP support. (tell your hw vendor)\n");
index 5e06fd14645516a3b3709cb9ee61c8cadf49e8d6..788c3fc6b9a7662f304495e2edfbd6c7ef341fb3 100644 (file)
@@ -808,12 +808,15 @@ alloc_p2m_table(struct domain *d)
     struct pfn_info *page, *l2page;
     l2_pgentry_t *l2;
     unsigned long mfn, pfn;
-    struct map_dom_mem_cache l2cache = MAP_DOM_MEM_CACHE_INIT;
-    struct map_dom_mem_cache l1cache = MAP_DOM_MEM_CACHE_INIT;
+    struct map_dom_mem_cache l1cache, l2cache;
 
     l2page = alloc_domheap_page(NULL);
-    if ( !l2page )
+    if ( l2page == NULL )
         return 0;
+
+    init_map_domain_mem_cache(&l1cache);
+    init_map_domain_mem_cache(&l2cache);
+
     d->arch.phys_table = mk_pagetable(page_to_phys(l2page));
     l2 = map_domain_mem_with_cache(page_to_phys(l2page), &l2cache);
     memset(l2, 0, PAGE_SIZE);
@@ -848,8 +851,8 @@ alloc_p2m_table(struct domain *d)
         list_ent = page->list.next;
     }
 
-    unmap_domain_mem_cache(&l2cache);
-    unmap_domain_mem_cache(&l1cache);
+    destroy_map_domain_mem_cache(&l2cache);
+    destroy_map_domain_mem_cache(&l1cache);
 
     return 1;
 }
index e10c7783b8050b00dfa173ce469d926301f8c390..6bd8b5a0be5278d622c2139fb1de901fbc2fcd12 100644 (file)
@@ -1,4 +1,4 @@
-/*******************************************************************************
+/******************************************************************************
  * Simple EDF scheduler for xen
  *
  * by Stephan Diestelhorst (C)  2004 Cambridge University
@@ -180,9 +180,10 @@ static inline void extraq_add_sort_update(struct exec_domain *d, int i, int sub)
        struct sedf_edom_info *curinf;
        
        ASSERT(!extraq_on(d,i));
-       PRINT(3, "Adding domain %i.%i (score= %i, short_pen= %lli) to L%i "\
-                "extraq\n", d->domain->id, d->id, EDOM_INFO(d)->score[i],
-                EDOM_INFO(d)->short_block_lost_tot, i);        
+       PRINT(3, "Adding domain %i.%i (score= %i, short_pen= %"PRIi64")"
+              " to L%i extraq\n",
+              d->domain->id, d->id, EDOM_INFO(d)->score[i],
+              EDOM_INFO(d)->short_block_lost_tot, i);  
        /*iterate through all elements to find our "hole" and on our way
          update all the other scores*/
        list_for_each(cur,EXTRAQ(d->processor,i)){
@@ -266,8 +267,8 @@ static inline void __del_from_queue(struct exec_domain *d)
 {
     struct list_head *list = LIST(d);
     ASSERT(__task_on_queue(d));
-    PRINT(3,"Removing domain %i.%i (bop= %llu) from runq/waitq\n", d->domain->id,
-          d->id, PERIOD_BEGIN(EDOM_INFO(d)));
+    PRINT(3,"Removing domain %i.%i (bop= %"PRIu64") from runq/waitq\n",
+          d->domain->id, d->id, PERIOD_BEGIN(EDOM_INFO(d)));
     list_del(list);
     list->next = NULL;
     ASSERT(!__task_on_queue(d));
@@ -307,8 +308,8 @@ int name##_comp(struct list_head* el1, struct list_head* el2) \
 DOMAIN_COMPARER(waitq, list, PERIOD_BEGIN(d1), PERIOD_BEGIN(d2))
 static inline void __add_to_waitqueue_sort(struct exec_domain *d) {
        ASSERT(!__task_on_queue(d));
-       PRINT(3,"Adding domain %i.%i (bop= %llu) to waitq\n", d->domain->id,
-             d->id, PERIOD_BEGIN(EDOM_INFO(d)));
+       PRINT(3,"Adding domain %i.%i (bop= %"PRIu64") to waitq\n",
+              d->domain->id, d->id, PERIOD_BEGIN(EDOM_INFO(d)));
        list_insert_sort(WAITQ(d->processor), LIST(d), waitq_comp);
        ASSERT(__task_on_queue(d));
 }
@@ -320,8 +321,8 @@ static inline void __add_to_waitqueue_sort(struct exec_domain *d) {
  */ 
 DOMAIN_COMPARER(runq, list, d1->deadl_abs, d2->deadl_abs)
 static inline void __add_to_runqueue_sort(struct exec_domain *d) {
-       PRINT(3,"Adding domain %i.%i (deadl= %llu) to runq\n", d->domain->id,
-             d->id, EDOM_INFO(d)->deadl_abs);
+       PRINT(3,"Adding domain %i.%i (deadl= %"PRIu64") to runq\n",
+              d->domain->id, d->id, EDOM_INFO(d)->deadl_abs);
        list_insert_sort(RUNQ(d->processor), LIST(d), runq_comp);
 }
 
@@ -530,9 +531,9 @@ struct list_head* waitq) {
                        /*we missed the deadline or the slice was
                                already finished... might hapen because
                                of dom_adj.*/
-                       PRINT(4,"\tDomain %i.%i exceeded it's deadline/"\
-                               "slice (%llu / %llu) now: %llu "\
-                               "cputime: %llu\n",
+                       PRINT(4,"\tDomain %i.%i exceeded it's deadline/"
+                               "slice (%"PRIu64" / %"PRIu64") now: %"PRIu64
+                               " cputime: %"PRIu64"\n",
                                curinf->exec_domain->domain->id,
                                curinf->exec_domain->id,
                                curinf->deadl_abs, curinf->slice, now,
@@ -599,7 +600,7 @@ static inline void desched_extra_dom(s_time_t now, struct exec_domain* d) {
                /*reduce block lost, probably more sophistication here!*/
                /*inf->short_block_lost_tot -= EXTRA_QUANTUM;*/
                inf->short_block_lost_tot -= now - inf->sched_start_abs;
-               PRINT(3,"Domain %i.%i: Short_block_loss: %lli\n", 
+               PRINT(3,"Domain %i.%i: Short_block_loss: %"PRIi64"\n", 
                      inf->exec_domain->domain->id, inf->exec_domain->id,
                      inf->short_block_lost_tot);
                if (inf->short_block_lost_tot <= 0) {
@@ -796,7 +797,7 @@ sched_done:
        /*TODO: Do something USEFUL when this happens and find out, why it
        still can happen!!!*/
        if (ret.time<0) {
-               printk("Ouch! We are seriously BEHIND schedule! %lli\n",
+               printk("Ouch! We are seriously BEHIND schedule! %"PRIi64"\n",
                       ret.time);
                ret.time = EXTRA_QUANTUM;
        }
@@ -1158,8 +1159,8 @@ void sedf_wake(struct exec_domain *d) {
                /*initial setup of the deadline*/
                inf->deadl_abs = now + inf->slice;
                
-       PRINT(3,"waking up domain %i.%i (deadl= %llu period= %llu "\
-               "now= %llu)\n", d->domain->id, d->id, inf->deadl_abs,
+       PRINT(3,"waking up domain %i.%i (deadl= %"PRIu64" period= %"PRIu64" "\
+               "now= %"PRIu64")\n", d->domain->id, d->id, inf->deadl_abs,
                 inf->period, now);
 #ifdef SEDF_STATS      
        inf->block_tot++;
@@ -1220,8 +1221,8 @@ void sedf_wake(struct exec_domain *d) {
                        extraq_check_add_unblocked(d, 1);
                }
        }
-       PRINT(3,"woke up domain %i.%i (deadl= %llu period= %llu "\
-               "now= %llu)\n", d->domain->id, d->id, inf->deadl_abs,
+       PRINT(3,"woke up domain %i.%i (deadl= %"PRIu64" period= %"PRIu64" "\
+               "now= %"PRIu64")\n", d->domain->id, d->id, inf->deadl_abs,
                inf->period, now);
        if (PERIOD_BEGIN(inf) > now) {
                __add_to_waitqueue_sort(d);
@@ -1258,21 +1259,21 @@ void sedf_wake(struct exec_domain *d) {
 static void sedf_dump_domain(struct exec_domain *d) {
        printk("%i.%i has=%c ", d->domain->id, d->id,
                test_bit(EDF_RUNNING, &d->flags) ? 'T':'F');
-       printk("p=%llu sl=%llu ddl=%llu w=%hu c=%llu sc=%i xtr(%s)=%llu ew=%hu",
+       printk("p=%"PRIu64" sl=%"PRIu64" ddl=%"PRIu64" w=%hu c=%"PRIu64" sc=%i xtr(%s)=%"PRIu64" ew=%hu",
          EDOM_INFO(d)->period, EDOM_INFO(d)->slice, EDOM_INFO(d)->deadl_abs,
          EDOM_INFO(d)->weight, d->cpu_time, EDOM_INFO(d)->score[EXTRA_UTIL_Q],
         (EDOM_INFO(d)->status & EXTRA_AWARE) ? "yes" : "no",
          EDOM_INFO(d)->extra_time_tot, EDOM_INFO(d)->extraweight);
        if (d->cpu_time !=0)
-               printf(" (%llu%%)", (EDOM_INFO(d)->extra_time_tot * 100)
+               printf(" (%"PRIu64"%%)", (EDOM_INFO(d)->extra_time_tot * 100)
                                 / d->cpu_time);
 #ifdef SEDF_STATS
        if (EDOM_INFO(d)->block_time_tot!=0)
-               printf(" pen=%llu%%", (EDOM_INFO(d)->penalty_time_tot * 100) /
+               printf(" pen=%"PRIu64"%%", (EDOM_INFO(d)->penalty_time_tot * 100) /
                                     EDOM_INFO(d)->block_time_tot);
        if (EDOM_INFO(d)->block_tot!=0)
                printf("\n   blks=%u sh=%u (%u%%) (shc=%u (%u%%) shex=%i "\
-                      "shexsl=%i) l=%u (%u%%) avg: b=%llu p=%llu",
+                      "shexsl=%i) l=%u (%u%%) avg: b=%"PRIu64" p=%"PRIu64"",
                    EDOM_INFO(d)->block_tot, EDOM_INFO(d)->short_block_tot,
                   (EDOM_INFO(d)->short_block_tot * 100) 
                  / EDOM_INFO(d)->block_tot, EDOM_INFO(d)->short_cont,
@@ -1296,7 +1297,7 @@ static void sedf_dump_cpu_state(int i)
        struct exec_domain    *ed;
        int loop = 0;
        
-       printk("now=%llu\n",NOW());
+       printk("now=%"PRIu64"\n",NOW());
        queue = RUNQ(i);
        printk("RUNQ rq %lx   n: %lx, p: %lx\n",  (unsigned long)queue,
                (unsigned long) queue->next, (unsigned long) queue->prev);
@@ -1396,8 +1397,8 @@ static inline int sedf_adjust_weights(struct sched_adjdom_cmd *cmd) {
 static int sedf_adjdom(struct domain *p, struct sched_adjdom_cmd *cmd) {
        struct exec_domain *ed;
 
-       PRINT(2,"sedf_adjdom was called, domain-id %i new period %llu "\
-               "new slice %llu\nlatency %llu extra:%s\n",
+       PRINT(2,"sedf_adjdom was called, domain-id %i new period %"PRIu64" "\
+               "new slice %"PRIu64"\nlatency %"PRIu64" extra:%s\n",
                p->id, cmd->u.sedf.period, cmd->u.sedf.slice,
                cmd->u.sedf.latency, (cmd->u.sedf.extratime)?"yes":"no");
        if ( cmd->direction == SCHED_INFO_PUT )
index cf98f2e1182b8ed0422bc7830020730077aeb323..2337197670642695d640e9338359e58af53ed480 100644 (file)
@@ -368,6 +368,7 @@ static __inline__ unsigned long find_first_set_bit(unsigned long word)
  * The Hamming Weight of a number is the total number of bits set in it.
  */
 
+#define hweight64(x) generic_hweight64(x)
 #define hweight32(x) generic_hweight32(x)
 #define hweight16(x) generic_hweight16(x)
 #define hweight8(x) generic_hweight8(x)
index 0220de530e8e4aa407362e1aa35685048141f8c9..b0ffad43a4be8920d1848602a107ca0eb63c09b6 100644 (file)
@@ -33,40 +33,45 @@ struct map_dom_mem_cache {
 
 #define MAP_DOM_MEM_CACHE_INIT { .pa = 0 }
 
+static inline void
+init_map_domain_mem_cache(struct map_dom_mem_cache *cache)
+{
+    ASSERT(cache != NULL);
+    *cache = MAP_DOM_MEM_CACHE_INIT;
+}
+
 static inline void *
-map_domain_mem_with_cache(unsigned long pa,
-                          struct map_dom_mem_cache *cache)
+map_domain_mem_with_cache(unsigned long pa, struct map_dom_mem_cache *cache)
 {
-    if ( likely(cache != NULL) )
+    ASSERT(cache != NULL);
+
+    if ( likely(cache->pa) )
     {
-        if ( likely(cache->pa) )
-        {
-            if ( likely((pa & PAGE_MASK) == (cache->pa & PAGE_MASK)) )
-                goto done;
-            unmap_domain_mem(cache->va);
-        }
-        cache->pa = (pa & PAGE_MASK) | 1;
-        cache->va = map_domain_mem(cache->pa);
-    done:
-        return (void *)(((unsigned long)cache->va & PAGE_MASK) |
-                        (pa & ~PAGE_MASK));
+        if ( likely((pa & PAGE_MASK) == (cache->pa & PAGE_MASK)) )
+            goto done;
+        unmap_domain_mem(cache->va);
     }
 
-    return map_domain_mem(pa);
+    cache->pa = (pa & PAGE_MASK) | 1;
+    cache->va = map_domain_mem(cache->pa);
+
+ done:
+    return (void *)(((unsigned long)cache->va & PAGE_MASK) |
+                    (pa & ~PAGE_MASK));
 }
 
 static inline void
-unmap_domain_mem_with_cache(void *va,
-                            struct map_dom_mem_cache *cache)
+unmap_domain_mem_with_cache(void *va, struct map_dom_mem_cache *cache)
 {
-    if ( unlikely(!cache) )
-        unmap_domain_mem(va);
+    ASSERT(cache != NULL);
+    unmap_domain_mem(va);
 }
 
 static inline void
-unmap_domain_mem_cache(struct map_dom_mem_cache *cache)
+destroy_map_domain_mem_cache(struct map_dom_mem_cache *cache)
 {
-    if ( likely(cache != NULL) && likely(cache->pa) )
+    ASSERT(cache != NULL);
+    if ( likely(cache->pa) )
     {
         unmap_domain_mem(cache->va);
         cache->pa = 0;
index 8a6081cde4e9592ab80c74e9af156ebed1346e83..2a59fb1e5e68ce8511c73a15c435103e86cea5dc 100644 (file)
 #define map_domain_mem(_pa)   phys_to_virt(_pa)
 #define unmap_domain_mem(_va) ((void)(_va))
 
+struct map_dom_mem_cache { 
+};
+
+#define init_map_domain_mem_cache(_c)      ((void)(_c))
+#define map_domain_mem_with_cache(_p,_c)   (map_domain_mem(_p))
+#define unmap_domain_mem_with_cache(_v,_c) ((void)(_v))
+#define destroy_map_domain_mem_cache(_c)   ((void)(_c))
+
 #endif /* __ASM_DOMAIN_PAGE_H__ */
diff --git a/xen/include/xen/inttypes.h b/xen/include/xen/inttypes.h
new file mode 100644 (file)
index 0000000..2163244
--- /dev/null
@@ -0,0 +1,251 @@
+/* Copyright (C) 1997-2001, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/*
+ *     ISO C99: 7.8 Format conversion of integer types <inttypes.h>
+ */
+
+#ifndef _XEN_INTTYPES_H
+#define _XEN_INTTYPES_H        1
+
+#include <xen/config.h>
+#include <xen/types.h>
+
+# if BITS_PER_LONG == 64
+#  define __PRI64_PREFIX       "l"
+#  define __PRIPTR_PREFIX      "l"
+# else
+#  define __PRI64_PREFIX       "ll"
+#  define __PRIPTR_PREFIX
+# endif
+
+/* Macros for printing format specifiers.  */
+
+/* Decimal notation.  */
+# define PRId8         "d"
+# define PRId16                "d"
+# define PRId32                "d"
+# define PRId64                __PRI64_PREFIX "d"
+
+# define PRIdLEAST8    "d"
+# define PRIdLEAST16   "d"
+# define PRIdLEAST32   "d"
+# define PRIdLEAST64   __PRI64_PREFIX "d"
+
+# define PRIdFAST8     "d"
+# define PRIdFAST16    __PRIPTR_PREFIX "d"
+# define PRIdFAST32    __PRIPTR_PREFIX "d"
+# define PRIdFAST64    __PRI64_PREFIX "d"
+
+
+# define PRIi8         "i"
+# define PRIi16                "i"
+# define PRIi32                "i"
+# define PRIi64                __PRI64_PREFIX "i"
+
+# define PRIiLEAST8    "i"
+# define PRIiLEAST16   "i"
+# define PRIiLEAST32   "i"
+# define PRIiLEAST64   __PRI64_PREFIX "i"
+
+# define PRIiFAST8     "i"
+# define PRIiFAST16    __PRIPTR_PREFIX "i"
+# define PRIiFAST32    __PRIPTR_PREFIX "i"
+# define PRIiFAST64    __PRI64_PREFIX "i"
+
+/* Octal notation.  */
+# define PRIo8         "o"
+# define PRIo16                "o"
+# define PRIo32                "o"
+# define PRIo64                __PRI64_PREFIX "o"
+
+# define PRIoLEAST8    "o"
+# define PRIoLEAST16   "o"
+# define PRIoLEAST32   "o"
+# define PRIoLEAST64   __PRI64_PREFIX "o"
+
+# define PRIoFAST8     "o"
+# define PRIoFAST16    __PRIPTR_PREFIX "o"
+# define PRIoFAST32    __PRIPTR_PREFIX "o"
+# define PRIoFAST64    __PRI64_PREFIX "o"
+
+/* Unsigned integers.  */
+# define PRIu8         "u"
+# define PRIu16                "u"
+# define PRIu32                "u"
+# define PRIu64                __PRI64_PREFIX "u"
+
+# define PRIuLEAST8    "u"
+# define PRIuLEAST16   "u"
+# define PRIuLEAST32   "u"
+# define PRIuLEAST64   __PRI64_PREFIX "u"
+
+# define PRIuFAST8     "u"
+# define PRIuFAST16    __PRIPTR_PREFIX "u"
+# define PRIuFAST32    __PRIPTR_PREFIX "u"
+# define PRIuFAST64    __PRI64_PREFIX "u"
+
+/* lowercase hexadecimal notation.  */
+# define PRIx8         "x"
+# define PRIx16                "x"
+# define PRIx32                "x"
+# define PRIx64                __PRI64_PREFIX "x"
+
+# define PRIxLEAST8    "x"
+# define PRIxLEAST16   "x"
+# define PRIxLEAST32   "x"
+# define PRIxLEAST64   __PRI64_PREFIX "x"
+
+# define PRIxFAST8     "x"
+# define PRIxFAST16    __PRIPTR_PREFIX "x"
+# define PRIxFAST32    __PRIPTR_PREFIX "x"
+# define PRIxFAST64    __PRI64_PREFIX "x"
+
+/* UPPERCASE hexadecimal notation.  */
+# define PRIX8         "X"
+# define PRIX16                "X"
+# define PRIX32                "X"
+# define PRIX64                __PRI64_PREFIX "X"
+
+# define PRIXLEAST8    "X"
+# define PRIXLEAST16   "X"
+# define PRIXLEAST32   "X"
+# define PRIXLEAST64   __PRI64_PREFIX "X"
+
+# define PRIXFAST8     "X"
+# define PRIXFAST16    __PRIPTR_PREFIX "X"
+# define PRIXFAST32    __PRIPTR_PREFIX "X"
+# define PRIXFAST64    __PRI64_PREFIX "X"
+
+
+/* Macros for printing `intmax_t' and `uintmax_t'.  */
+# define PRIdMAX       __PRI64_PREFIX "d"
+# define PRIiMAX       __PRI64_PREFIX "i"
+# define PRIoMAX       __PRI64_PREFIX "o"
+# define PRIuMAX       __PRI64_PREFIX "u"
+# define PRIxMAX       __PRI64_PREFIX "x"
+# define PRIXMAX       __PRI64_PREFIX "X"
+
+
+/* Macros for printing `intptr_t' and `uintptr_t'.  */
+# define PRIdPTR       __PRIPTR_PREFIX "d"
+# define PRIiPTR       __PRIPTR_PREFIX "i"
+# define PRIoPTR       __PRIPTR_PREFIX "o"
+# define PRIuPTR       __PRIPTR_PREFIX "u"
+# define PRIxPTR       __PRIPTR_PREFIX "x"
+# define PRIXPTR       __PRIPTR_PREFIX "X"
+
+
+/* Macros for scanning format specifiers.  */
+
+/* Signed decimal notation.  */
+# define SCNd8         "hhd"
+# define SCNd16                "hd"
+# define SCNd32                "d"
+# define SCNd64                __PRI64_PREFIX "d"
+
+# define SCNdLEAST8    "hhd"
+# define SCNdLEAST16   "hd"
+# define SCNdLEAST32   "d"
+# define SCNdLEAST64   __PRI64_PREFIX "d"
+
+# define SCNdFAST8     "hhd"
+# define SCNdFAST16    __PRIPTR_PREFIX "d"
+# define SCNdFAST32    __PRIPTR_PREFIX "d"
+# define SCNdFAST64    __PRI64_PREFIX "d"
+
+/* Signed decimal notation.  */
+# define SCNi8         "hhi"
+# define SCNi16                "hi"
+# define SCNi32                "i"
+# define SCNi64                __PRI64_PREFIX "i"
+
+# define SCNiLEAST8    "hhi"
+# define SCNiLEAST16   "hi"
+# define SCNiLEAST32   "i"
+# define SCNiLEAST64   __PRI64_PREFIX "i"
+
+# define SCNiFAST8     "hhi"
+# define SCNiFAST16    __PRIPTR_PREFIX "i"
+# define SCNiFAST32    __PRIPTR_PREFIX "i"
+# define SCNiFAST64    __PRI64_PREFIX "i"
+
+/* Unsigned decimal notation.  */
+# define SCNu8         "hhu"
+# define SCNu16                "hu"
+# define SCNu32                "u"
+# define SCNu64                __PRI64_PREFIX "u"
+
+# define SCNuLEAST8    "hhu"
+# define SCNuLEAST16   "hu"
+# define SCNuLEAST32   "u"
+# define SCNuLEAST64   __PRI64_PREFIX "u"
+
+# define SCNuFAST8     "hhu"
+# define SCNuFAST16    __PRIPTR_PREFIX "u"
+# define SCNuFAST32    __PRIPTR_PREFIX "u"
+# define SCNuFAST64    __PRI64_PREFIX "u"
+
+/* Octal notation.  */
+# define SCNo8         "hho"
+# define SCNo16                "ho"
+# define SCNo32                "o"
+# define SCNo64                __PRI64_PREFIX "o"
+
+# define SCNoLEAST8    "hho"
+# define SCNoLEAST16   "ho"
+# define SCNoLEAST32   "o"
+# define SCNoLEAST64   __PRI64_PREFIX "o"
+
+# define SCNoFAST8     "hho"
+# define SCNoFAST16    __PRIPTR_PREFIX "o"
+# define SCNoFAST32    __PRIPTR_PREFIX "o"
+# define SCNoFAST64    __PRI64_PREFIX "o"
+
+/* Hexadecimal notation.  */
+# define SCNx8         "hhx"
+# define SCNx16                "hx"
+# define SCNx32                "x"
+# define SCNx64                __PRI64_PREFIX "x"
+
+# define SCNxLEAST8    "hhx"
+# define SCNxLEAST16   "hx"
+# define SCNxLEAST32   "x"
+# define SCNxLEAST64   __PRI64_PREFIX "x"
+
+# define SCNxFAST8     "hhx"
+# define SCNxFAST16    __PRIPTR_PREFIX "x"
+# define SCNxFAST32    __PRIPTR_PREFIX "x"
+# define SCNxFAST64    __PRI64_PREFIX "x"
+
+
+/* Macros for scanning `intmax_t' and `uintmax_t'.  */
+# define SCNdMAX       __PRI64_PREFIX "d"
+# define SCNiMAX       __PRI64_PREFIX "i"
+# define SCNoMAX       __PRI64_PREFIX "o"
+# define SCNuMAX       __PRI64_PREFIX "u"
+# define SCNxMAX       __PRI64_PREFIX "x"
+
+/* Macros for scaning `intptr_t' and `uintptr_t'.  */
+# define SCNdPTR       __PRIPTR_PREFIX "d"
+# define SCNiPTR       __PRIPTR_PREFIX "i"
+# define SCNoPTR       __PRIPTR_PREFIX "o"
+# define SCNuPTR       __PRIPTR_PREFIX "u"
+# define SCNxPTR       __PRIPTR_PREFIX "x"
+
+#endif /* _XEN_INTTYPES_H */
index 91c34ce2325a3c7774e986ca6392f44cb16cb3eb..b8a981a632dbe449426903b0f48c38bf62b6f135 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef __LIB_H__
 #define __LIB_H__
 
+#include <xen/inttypes.h>
 #include <stdarg.h>
 #include <xen/config.h>
 #include <xen/types.h>